import request from '@/utils/request'
import apis from '@/api/index'

export function getDesignList (parameter) {
  return request({
    url: apis.DesignList,
    method: 'get',
    params: parameter
  })
}

export function getDesignHistory (id) {
  return request({
    url: `${apis.DesignHistory}?cb_id=${id}`,
    method: 'get'
  })
}
export function getDesignStatus (id) {
  return request({
    url: `${apis.DesignStatus}?cb_id=${id}`,
    method: 'get'
  })
}
export function postDesignStatus (id, data) {
  return request({
    url: `${apis.DesignStatus}?cb_id=${id}`,
    method: 'post',
    data: data
  })
}
export function getDesignUpload (id) {
  return request({
    url: `${apis.DesignUpload}?cb_id=${id}`,
    method: 'get'
  })
}

export function postDesignUpload (id, data) {
  return request({
    url: `${apis.DesignUpload}?cb_id=${id}`,
    method: 'post',
    data: data
  })
}

export function getDesignDownload (id) {
  return request({
    url: `${apis.DesignDownload}?cb_id=${id}`,
    method: 'get'
  })
}

export function appointDesign (id, data) {
  return request({
    url: `${apis.GetDesign}?cb_id=${id}`,
    method: 'post',
    data: data
  })
}

export function getDesignDetail (id) {
  return request({
    url: `${apis.DesignDetail}?cb_id=${id}`,
    method: 'get'
  })
}

export function getDesignData (parameter) {
  return request({
    url: apis.DesignData,
    method: 'get',
    params: parameter
  })
}

export function getDesignerData (parameter) {
  return request({
    url: apis.DesignerDetail,
    method: 'get',
    params: parameter
  })
}

export function getListByDesigner (parameter) {
  return request({
    url: apis.DesignerDetail,
    method: 'get',
    params: parameter
  })
}

export function getListByBusiness (parameter) {
  return request({
    url: apis.BusinessDetail,
    method: 'get',
    params: parameter
  })
}

export function getDesignBusiness (parameter) {
  return request({
    url: apis.DesignStatsBusiness,
    method: 'get',
    params: parameter
  })
}

export function getDesignMember (parameter) {
  return request({
    url: apis.DesignMember,
    method: 'get',
    params: parameter
  })
}

export function getAdd () {
  return request({
    url: apis.AddDesignMember,
    method: 'get'
  })
}

export function postAdd (data) {
  return request({
    url: apis.AddDesignMember,
    method: 'post',
    data: data
  })
}

export function getEdit (uid) {
  return request({
    url: `${apis.EditDesignMember}?uid=${uid}`,
    method: 'get'
  })
}

export function postEdit (uid, data) {
  return request({
    url: `${apis.EditDesignMember}?uid=${uid}`,
    method: 'post',
    data: data
  })
}

export function delDesignMember (uid) {
  return request({
    url: `${apis.DelDesignMember}?uid=${uid}`,
    method: 'post'
  })
}
